﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:controls="using:System.Windows.Controls"
  xmlns:controlsPrimitives="using:System.Windows.Controls.Primitives">

    <Style TargetType="controlsPrimitives:CalendarItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controlsPrimitives:CalendarItem">
                    <Grid>
                        <Grid.Resources>
                            <SolidColorBrush x:Key="DisabledBrush" Color="#8CFFFFFF" />
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="DisabledVisual"
                                          Storyboard.TargetProperty="Opacity"
                                          To="1"
                                          Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border
                          BorderThickness="{TemplateBinding BorderThickness}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          Background="{TemplateBinding Background}"
                          Margin="0,2,0,2"
                          CornerRadius="1">
                            <Border
                              CornerRadius="1"
                              BorderBrush="#FFFFFFFF"
                              BorderThickness="2">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <Grid.Resources>
                                        <ControlTemplate x:Key="HeaderButtonTemplate" TargetType="Button">
                                            <Grid>
                                                <!-- TODO: Cursor="Hand"-->
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation
                                                                  Storyboard.TargetName="Content"
                                                                  Storyboard.TargetProperty="(ContentControl.Foreground).(SolidColorBrush.Color)"
                                                                  To="#FF73A9D8"
                                                                  Duration="0" />
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <DoubleAnimation
                                                                  Storyboard.TargetName="Content"
                                                                  Storyboard.TargetProperty="Opacity"
                                                                  To=".5"
                                                                  Duration="0" />
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                
                                                <ContentControl
                                                  x:Name="Content"
                                                  IsTabStop="False"
                                                  Foreground="#FF333333"
                                                  Content="{TemplateBinding Content}"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  Margin="1,5,1,9"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                            </Grid>
                                        </ControlTemplate>

                                        <DataTemplate x:Name="DayTitleTemplate">
                                            <TextBlock
                                              FontWeight="Bold" 
                                              FontSize="9.5" 
                                              Text="{Binding}"
                                              Margin="0,4,0,4"
                                              HorizontalAlignment="Center"
                                              VerticalAlignment="Center" />
                                        </DataTemplate>
                                        
                                        <ControlTemplate x:Key="PreviousButtonTemplate" TargetType="Button">
                                            <Grid>
                                                <!-- TODO: Cursor="Hand"-->
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation
                                                                  Storyboard.TargetName="IconPath"
                                                                  Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
                                                                  To="#FF73A9D8"
                                                                  Duration="0" />
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <DoubleAnimation
                                                                  Storyboard.TargetName="IconPath"
                                                                  Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Opacity)"
                                                                  To=".5"
                                                                  Duration="0" />
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                
                                                <Rectangle
                                                  Fill="#11E5EBF1"
                                                  Stretch="Fill"
                                                  Opacity="1" />
                                                <Grid>
                                                    <Path
                                                      x:Name="IconPath"
                                                      Fill="#FF333333"
                                                      Margin="14,-6,0,0"
                                                      Height="10"
                                                      Width="6"
                                                      VerticalAlignment="Center"
                                                      HorizontalAlignment="Left"
                                                      Stretch="Fill"
                                                      Data="M288.75,232.25 L288.75,240.625 L283,236.625 z" />
                                                </Grid>
                                            </Grid>
                                        </ControlTemplate>

                                        <ControlTemplate x:Key="NextButtonTemplate" TargetType="Button">
                                            <Grid>
                                                <!-- TODO: Cursor="Hand"-->
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation
                                                                  Storyboard.TargetName="IconPath"
                                                                  Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
                                                                  To="#FF73A9D8"
                                                                  Duration="0" />
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <DoubleAnimation
                                                                  Storyboard.TargetName="IconPath"
                                                                  Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Opacity)"
                                                                  To=".5"
                                                                  Duration="0" />
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                
                                                <Rectangle
                                                  Fill="#11E5EBF1"
                                                  Stretch="Fill"
                                                  Opacity="1" />
                                                <Grid>
                                                    <Path
                                                      x:Name="IconPath"
                                                      Fill="#FF333333"
                                                      Margin="0,-6,14,0"
                                                      Height="10"
                                                      Width="6"
                                                      Stretch="Fill"
                                                      VerticalAlignment="Center"
                                                      HorizontalAlignment="Right"
                                                      Data="M282.875,231.875 L282.875,240.375 L288.625,236 z" />
                                                </Grid>
                                            </Grid>
                                        </ControlTemplate>
                                    </Grid.Resources>

                                    <Button
                                      x:Name="PreviousButton"
                                      Height="20"
                                      Width="28"
                                      Visibility="Collapsed"
                                      Template="{StaticResource PreviousButtonTemplate}"
                                      HorizontalAlignment="Left"/>

                                    <Button
                                      x:Name="HeaderButton"
                                      Grid.Column="1"
                                      FontWeight="Bold"
                                      FontSize="10.5"
                                      Template="{StaticResource HeaderButtonTemplate}"
                                      HorizontalAlignment="Center"
                                      VerticalAlignment="Center" />

                                    <Button
                                      x:Name="NextButton"
                                      Grid.Column="2"
                                      Height="20"
                                      Width="28"
                                      Visibility="Collapsed"
                                      Template="{StaticResource NextButtonTemplate}"
                                      HorizontalAlignment="Right" />

                                    <Grid
                                      x:Name="MonthView"
                                      Grid.Row="1"
                                      Grid.ColumnSpan="3"
                                      Visibility="Collapsed"
                                      Margin="6,-1,6,6">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                    </Grid>

                                    <Grid
                                      x:Name="YearView"
                                      Grid.Row="1"
                                      Grid.ColumnSpan="3"
                                      Visibility="Collapsed"
                                      Margin="6,-3,7,6">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                    </Grid>
                                </Grid>
                            </Border>
                        </Border>
                        
                        <Rectangle
                          x:Name="DisabledVisual"
                          Opacity="0"
                          Visibility="Collapsed"
                          Stretch="Fill"                          
                          RadiusX="2"
                          RadiusY="2"
                          StrokeThickness="1"
                          Stroke="{StaticResource DisabledBrush}"
                          Fill="{StaticResource DisabledBrush}"
                          Margin="0,2,0,2" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
